// import {
// 	getEventType as apiGetEventType,
// } from "@/api/Interface/event"
// import {
// 	DicEnum
// } from "@/enums/event"
import {
	formKeys
} from "../report.form.config"
import {
	useGetEventLevel
} from "../hooks/useEventLevel"
export default {
	data() {
		return {
			mel_levelShow: false,
			mel_levelList: [],
			mel_defaultIndex: 1
		}
	},
	onLoad() {
		this.melGetEventLevel()
	},
	onReady() {
		this.melLevelConfirm({
			detail: {
				value: 1
			}
		});
	},
	methods: {
		// 获取事件紧急程度
		melGetEventLevel() {
			// apiGetEventType({
			// 	pageNum: 1,
			// 	pageSize: 999999,
			// 	dictType: DicEnum.level
			// }).then(res => {
			// 	if (res.code === 200) {
			// 		this.mel_levelList = res.rows;
			// 		this.mel_levelList.forEach(item => {
			// 			this.$set(item, "label", item.dictLabel)
			// 			this.$set(item, "value", item.dictValue)
			// 		})
			// 	}
			// })
			useGetEventLevel().then(res => {
				if (res.code === 200) {
					this.mel_levelList = res.rows;
					this.mel_levelList.forEach(item => {
						this.$set(item, "label", item.dictLabel)
						this.$set(item, "value", item.dictValue)
					})
				}
			})
		},
		// 事件紧急程度选择回调
		melLevelConfirm(e) {
			console.log('select选择回调', e);
			this.mel_defaultIndex = e.detail.value; // this.mel_levelList.findIndex(f => f.value === );
			this.form[formKeys.eventLevel] = this.mel_levelList[this.mel_defaultIndex].value;
		},
		// 事件紧急程度关闭回调
		melLevelClose() {
			this.levelShow = false;
		},
	}
}
